The present invention relates generally to improved techniques for processing of barcode information. More particularly, the invention relates to methods and apparatus for weighted mean averaging of digitized barcode data in order to reduce errors caused by noise.
A barcode signal is typically produced by passing or scanning a laser beam across a barcode. The barcode scatters the light from the laser beam onto a lens or mirror which focuses the light onto a photodetector. The photodetector converts the light into a photocurrent signal. The light falling on the photodetector varies due to modulation by the varying reflectivity of the light and dark bars which make up the barcode. The photocurrent signal changes during the scanning process because the laser passes through light and dark regions as it passes across the barcode, causing variations in the intensity of the light falling on the photodetector. The photocurrent signal thus provides a representation of the regions of lightness and darkness of the barcode, and can be processed to identify logic transitions represented by the barcode.
Processing of the barcode signal to identify logic transitions may typically involve generating first and second derivatives of the signal and identifying a logic transition at each point where the second derivative undergoes a zero crossing and a peak in the first derivative exceeds a predetermined threshold. If the signal has not been significantly degraded by noise, the first derivative will have only one peak at a time and the second derivative will undergo a zero crossing once in the vicinity of the peak, allowing accurate identification of a logic transition.
Barcodes are widely used and appear on a great variety of surfaces. Some barcodes are difficult to read because the surfaces on which they appear contribute substantial noise to the barcode signal. By way of example, a significant problem is presented by a barcode printed directly on a typical egg carton. Such cartons have very rough and textured surfaces and are often dull gray in color. Printing a barcode on this surface often results in a barcode with significant defects, including rough edges and low contrast. Scanning such a barcode produces a noisy signal because of the large variations in the scattering of the scanning laser by the rough and textured surface. This kind of noise is called paper noise because it is related to the quality of the substrate of a barcode and the most common substrate is paper. Paper noise generated from an egg carton is generally hard to reduce significantly without reducing the signal because the noise is in the same frequency range as the signal. In particular, noise may split a first derivative peak into two or more peaks. This split results in additional zero crossings in the second derivative signal, leading to incorrect identifications of logic transitions in the barcode signal.
It is possible to digitize the analog barcode signal produced by scanning the barcode. Details of digitizing barcode signals are presented in U.S. patent application Ser. No. 09/558,715, filed Apr. 26, 2000 and assigned to the assignee of the present invention, which is incorporated herein by reference in its entirety. Digitizing the barcode signal allows for filtering out high frequency noise without phase distortion, greater freedom in optimizing filter parameters, greater freedom in generating thresholds of desired characteristics and the ability to use digital techniques to process the signal. The ability to use digital techniques to process a barcode signal allows greater ease and flexibility in processing the signal. However, a digital signal produced by digitizing a photosignal which has been affected by noise continues to suffer ill effects resulting from the noise present in the noisy photosignal. A photosignal corrupted by noise is likely to produce a first derivative signal with false multiple peaks resulting from noise, and these false multiple peaks will continue to be present in a digital first derivative signal. The digital signal is more readily adapted to processing to prevent errors resulting from noise effects than an analog signal would be, but processing techniques need to be developed and the digital signal processed using these techniques in order to reduce the possibility of errors resulting from noise.
There exists, therefore, a need in the art for a system which takes advantage of the ease and flexibility afforded by the use of digital processing techniques in processing a barcode signal to overcome the effects of noise, such as the exemplary paper noise discussed above.
A barcode processing system according to the present invention employs digital techniques to create a digital first derivative signal and then processes the signal to overcome the effects of noise. A barcode is scanned to produce reflected light which falls on a photodetector to produce a photocurrent signal. The photocurrent signal is passed to an amplified, and may be subjected to analog differentiation to produce a first derivative signal. The first derivative signal is digitized with an analog to digital converter to produce a digitized first derivative signal. The analog to digital converter takes samples of the first derivative signal in order to construct a digital representation of the signal. It measures the signal level and assigns a digital value that is a multiple of the smallest digital increment, 2xe2x88x92N, where N is the number of output bits of the ADC. The ADC must have a sufficient number of bits of output, and must sample at a sufficient rate, to reduce errors to an acceptable level. The allowable error is preferably less than 5% of the width of the narrowest bar or space of a barcode. The digitized signal is then processed using a digital processor such as an application specific integrated circuit (ASIC) to recover barcode information.
Once the digital first derivative signal is created, it is filtered using a Gaussian filter. At this point, the digital first derivative signal is analyzed to create a positive and negative threshold in order to compare peaks of the digital first derivative signal against the threshold values. The threshold has a base DC component and an additional AC component. The AC component varies with the digital first derivative signal. Once the threshold is created, the digital first derivative signal is processed using an area weighted mean (AWMn) algorithm in order to identify a geometric center of a processing region in which the first derivative signal exceeds the threshold. In the absence of noise, a first derivative curve will have only one peak within a threshold window, that is, the time period during which the first derivative curve exceeds the threshold. The peak will be approximately centered in the window. The geometric center identified using the area weighted mean algorithm is in nearly the same location as a signal peak would be in the absence of noise.
Once the digital first derivative signal is processed using the area weighted mean algorithm, each geometrical center of a processing region is identified as representing a logic transition.
A more complete understanding of the present invention, as well as further features and advantages of the invention, will be apparent from the following Detailed Description and the accompanying drawings.